package pdn.sci.cs.entity;

// Generated Jan 13, 2012 10:49:29 AM by Hibernate Tools 3.4.0.CR1

import java.util.Calendar;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "chief_occupant", catalog = "police_db")
public class ChiefOccupant extends BaseEntity implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private GramaSevakaDevision gramaSevakaDevision;
	private String name;
	private String nic;
	private String address;

	private Set<FamilyMember> familyMembers = new HashSet<FamilyMember>(0);
	private Set<OtherResident> otherResidents = new HashSet<OtherResident>(0);

	public ChiefOccupant() {
	}

	public ChiefOccupant(String id, GramaSevakaDevision gramaSevakaDevision,
			String name, String address) {
		this.id = id;
		this.gramaSevakaDevision = gramaSevakaDevision;
		this.name = name;
		this.address = address;
	}

	public ChiefOccupant(String id, GramaSevakaDevision gramaSevakaDevision,
			String name, String nic, String address, Integer sortOrder,
			String insertUserId, String updateUserId, Calendar insertDatetime,
			Calendar updateDatetime, Set<FamilyMember> familyMembers, Set<OtherResident> otherResidents) {
		this.id = id;
		this.gramaSevakaDevision = gramaSevakaDevision;
		this.name = name;
		this.nic = nic;
		this.address = address;
		this.sortOrder = sortOrder;
		this.insertUserId = insertUserId;
		this.updateUserId = updateUserId;
		this.insertDatetime = insertDatetime;
		this.updateDatetime = updateDatetime;
		this.familyMembers = familyMembers;
		this.otherResidents = otherResidents;
	}

	
	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GRAMA_SEVAKA_DEVISION_ID", nullable = false)
	public GramaSevakaDevision getGramaSevakaDevision() {
		return this.gramaSevakaDevision;
	}

	public void setGramaSevakaDevision(GramaSevakaDevision gramaSevakaDevision) {
		this.gramaSevakaDevision = gramaSevakaDevision;
	}

	@Column(name = "NAME", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "NIC", length = 10)
	public String getNic() {
		return this.nic;
	}

	public void setNic(String nic) {
		this.nic = nic;
	}

	@Column(name = "ADDRESS", nullable = false)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}



	@OneToMany(fetch = FetchType.LAZY, mappedBy = "chiefOccupant")
	public Set<FamilyMember> getFamilyMembers() {
		return this.familyMembers;
	}

	public void setFamilyMembers(Set<FamilyMember> familyMembers) {
		this.familyMembers = familyMembers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "chiefOccupant")
	public Set<OtherResident> getOtherResidents() {
		return this.otherResidents;
	}

	public void setOtherResidents(Set<OtherResident> otherResidents) {
		this.otherResidents = otherResidents;
	}

}
